#include #include using namespace std; //array - list of variables with one name //you should name arryas with a plural name //off-by-one-error //out of bounds errors //parallel arrays - two or more arrays related by their subscripts void main() { const int MAX_GRADES = 10; //the number inside the [] is called the size of the array //the size must be a whole number > 0, //the size must be a literal or constant (can not be a variable) int grades[MAX_GRADES] = {0};// = {1,2,3,4,5}; //initialize an array //for(int i = 0; i < MAX_GRADES; i++) //{ // //the integer in the [] is called the subscript // //valid subscripts are 0 thru size -1 // //the subscript must be a whole number // //the size can be a literal or constant or variable // cout << "Grade " << i+1 << "? "; // cin >> grades[i]; //} for(int i = 0; i < MAX_GRADES; i++) { cout << "Grade " << i+1 << " = " << grades[i] << endl; } int gradeIndex; cout << "Which grade would you like to see? "; cin >> gradeIndex; grades[gradeIndex-1] = 0; cout << grades[gradeIndex-1] << endl; }